#include "mytime0.h"
#include "iostream"

int main()
{
    using std::cout;
    using std::endl;
    Time planning;
    Time total;
    cout << "Planning time:";
    planning.Show();

    Time codding(2, 40);
    cout << "Codding time:";
    codding.Show();

    // 使用指针调用对象方法
    Time *pTime = new Time(2,30);
    cout << "pTime:";
    pTime->Show();

    Time fixing(5,55);
    cout << "Fixing time:";
    fixing.Show();
    total = codding + fixing;
    cout << "total = ";
    total.Show();

    Time moreFixing(1, 10);
    total = total + moreFixing + moreFixing;
    cout << "more fixing total:";
    total.Show();

    Time subTime;
    subTime = fixing - codding;
    cout << "Fixing - Codding : ";
    subTime.Show();

    Time muti;
    muti = moreFixing * 2;
    cout << "Muti: ";
    muti.Show();

    //使用友元函数
    Time friendTime;
    int aInt = 2;
    friendTime = aInt * moreFixing;
    cout << "Friend: ";
    friendTime.Show();

    cout << "Overloading <<: ";
    cout << muti << friendTime;
    return 0;
}
